<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="shortcut icon" href="favicon.ico"> <link href="./src/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
        <link href="./src/css/font-awesome.css?v=4.4.0" rel="stylesheet">
        <link href="./src/css/plugins/iCheck/custom.css" rel="stylesheet">
        <link href="./src/css/animate.css" rel="stylesheet">
        <link rel="stylesheet" href="./src/css/fuzzyquery.css">
        <link href="./src/css/style.css?v=4.1.0" rel="stylesheet">
        <link href="./src/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
        <link href="./src/css/plugins/chosen/chosen.css" rel="stylesheet">
        <script src="./src/js/My97DatePicker/WdatePicker.js"></script>
    </head>
    <body>
        <div class="ibox-content">
            <form class="form-horizontal">
                <input type="hidden" name="m" value="carservice">
                <input type="hidden" name="a" value="vehicle">
                <div class="form-group">
                    <label class="col-sm-2 control-label" style="width: 100px;">车牌号：</label>

                    <div class="col-sm-2">
                        <input  class="form-control m-b" name="name" style="padding-top:2px;" value="<?php echo $this->name ?>">
                    </div>
                    <label class="col-sm-2 control-label" style="width: 100px;">所属车队：</label>

                    <div class="col-sm-2">
                        <input  class="form-control m-b" name="team_id" style="padding-top:2px;" value="<?php echo $this->team_id ?>">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" style="width: 100px;">当前状态：</label>
                    <div class="col-sm-2">
                        <select class="form-control m-b" name="status" style="padding-top:2px;">
                            <option value='0' <?php echo ($this->status == 0) ? 'selected' : '' ?> >全部</option>
                            <option value='1' <?php echo ($this->status == 1) ? 'selected' : '' ?> >激活</option>
                            <option value='2' <?php echo ($this->status == 2) ? 'selected' : '' ?> >休眠</option>
                        </select>
                    </div>
                    <div class="col-sm-1">
                        <button class="btn btn-sm btn-info" type="submit">搜索</button>
                    </div>
                </div>
            </form>
        </div>
        <div class="row">
            <div class="ibox float-e-margins" style="width:98%;margin-left:1%;">
                <div class="ibox-title">
                    <button class="btn btn-success " style="margin-top:-10px;" type="button" data-toggle="modal" data-target="#myModal5"><span class="bold">新增</span></button>
                    <div style="display: none;"><button class="btn btn-success " style="margin-top:-10px;" type="button" data-toggle="modal" data-target="#myModal6" id="update"><span class="bold">修改</span></button></div>   
                    <button class="btn btn-success " style="margin-top:-10px;" type="button" id="toupdate"><span class="bold">修改</span></button> 
                    <button class="btn btn-success " style="margin-top:-10px;" type="button" id="delete"><span class="bold">删除</span></button> 
                    <button class="btn btn-success " style="margin-top:-10px;" type="button" id="dormancy"><span class="bold">休眠</span></button>    
                    <button class="btn btn-success " style="margin-top:-10px;" type="button" id="activation"><span class="bold">激活</span></button>    
                </div>
                <div class="ibox-content">

                    <table class="table table-bordered">
                        <thead>
                            <tr>
                                <th>排序</th>
                                <th>所属车队</th>
                                <th>车牌号</th>
                                <th>车辆编号</th>
                                <th>司机</th>
                                <th>司机手机</th>
                                <th>经营方式</th>
                                <th>状态</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php foreach ($this->data as $k => $v) { ?>
                                <tr>
                            <input type="hidden" value="<?php echo $v['id'] ?>">
                            <td><?php echo $v['id'] ?></td>
                            <td><?php echo @$this->team_info[$v['team_id']] ?></td>
                            <td><?php echo $v['name'] ?></td>
                            <td><?php echo $v['code'] ?></td>
                            <td><?php echo @$this->driver_info[$v['driver_id']]['name'] ?></td>
                            <td><?php echo @$this->driver_info[$v['driver_id']]['telephone'] ?></td>
                            <td><?php echo $v['bussiness_mode'] ?></td>
                            <td><?php echo ($v['status'] == 1) ? '激活' : '休眠' ?></td>
                            </tr>
                        <?php } ?>
                        </tbody>
                    </table>

                </div>
            </div>
        </div>
        <div class="admin-table-page" style="margin-left:20px;">
            <div id="page" class="page">
                <?php echo $this->paging; ?>
            </div>
        </div>
        <div class="modal inmodal fade" id="myModal5" tabindex="-1" role="dialog"  aria-hidden="true">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 class="modal-title">车辆信息新增</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal">
                            <div class="form-group">

                                <label class="col-sm-2 control-label">车牌号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="name" name="account">
                                </div>
                                <label class="col-sm-2 control-label">车辆编号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="code" name="account">
                                </div>

                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">所属车队：</label>
                                <div class="col-sm-3">
                                    <select class="form-control m-b" id="team_id" name="status" style="padding-top:2px;">
                                        <?php foreach ($this->team as $k => $v) { ?>
                                            <option value="<?php echo $v['id'] ?>" hassubinfo="true"><?php echo $v['name'] ?></option>
                                        <?php } ?>
                                    </select>
                                </div>
                                <label class="col-sm-2 control-label">司机：</label>
                                <div class="col-sm-3">
                                    <select class="form-control m-b" id="driver_id" name="status" style="padding-top:2px;">
                                        <?php foreach ($this->driver as $k => $v) { ?>
                                            <option value="<?php echo $v['id'] ?>" hassubinfo="true"><?php echo $v['name'] ?></option>
                                        <?php } ?>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">车辆型号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="mode" name="account">
                                </div>
                                <label class="col-sm-2 control-label">发动机号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="engineer" name="account">
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">车头重量：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="head_weight" name="account">
                                </div>
                                <label class="col-sm-2 control-label">载重量：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="load_weight" name="account">
                                </div>

                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">海关编号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="ciq_code" name="account">
                                </div>
                                <label class="col-sm-2 control-label">通关卡号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="clearance_card" name="account">
                                </div>

                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">IC卡号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="ic_card" name="account">
                                </div>
                                <label class="col-sm-2 control-label">电子关锁号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="electronics_clock" name="account">
                                </div>
                            </div>


                            <div class="form-group">

                                <label class="col-sm-2 control-label">经营方式：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="bussiness_mode" name="account">
                                </div>
                            </div>

                            <div class="form-group">

                                <label class="col-sm-2 control-label">行驶证号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="driving_license_code" name="account">
                                </div>
                                <label class="col-sm-2 control-label">行驶证有效期：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="driving_license_date" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="account">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">交强险单号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="insurance_force_code" name="account">
                                </div>
                                <label class="col-sm-2 control-label">交强险有效期：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="insurance_force_date" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss'})"  name="account">
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">二级维护卡号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="maintain_code" name="account">
                                </div>
                                <label class="col-sm-2 control-label">二级维护卡有效期：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="maintain_date" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss'})"  name="account">
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">商业险单号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="insurance_business_code" name="account">
                                </div>
                                <label class="col-sm-2 control-label">商业险有效期：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="insurance_business_date" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="account">
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">营运审核号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="taxi_license_code" name="account">
                                </div>
                                <label class="col-sm-2 control-label">营运证综合审核期：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="taxi_license_date" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="account">
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">提醒人：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="remind_id" name="account">
                                </div>
                                <label class="col-sm-2 control-label">提前提醒天数：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="remind_day" name="account">
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">备注：</label>
                                <div class="col-sm-8">
                                    <textarea id="remark" name="comment" class="form-control" required="" aria-required="true"></textarea>
                                </div>
                            </div>

                        </form>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-white" id="gb" data-dismiss="modal">关闭</button>
                            <button type="button" class="btn btn-primary" id="baocun">保存</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="modal inmodal fade" id="myModal6" tabindex="-1" role="dialog"  aria-hidden="true">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 class="modal-title">车辆信息修改</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal">
                            <div class="form-group">

                                <label class="col-sm-2 control-label">车牌号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="uname" name="account">
                                </div>
                                <label class="col-sm-2 control-label">车辆编号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="ucode" name="account">
                                </div>

                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">所属车队：</label>
                                <div class="col-sm-3">
                                    <select class="form-control m-b" id="uteam_id" name="status" style="padding-top:2px;">
                                        <?php foreach ($this->team as $k => $v) { ?>
                                            <option value="<?php echo $v['id'] ?>" hassubinfo="true"><?php echo $v['name'] ?></option>
                                        <?php } ?>
                                    </select>
                                </div>
                                <label class="col-sm-2 control-label">司机：</label>
                                <div class="col-sm-3">
                                    <select class="form-control m-b" id="udriver_id" name="status" style="padding-top:2px;">
                                        <?php foreach ($this->driver as $k => $v) { ?>
                                            <option value="<?php echo $v['id'] ?>" hassubinfo="true"><?php echo $v['name'] ?></option>
                                        <?php } ?>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">车辆型号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="umode" name="account">
                                </div>
                                <label class="col-sm-2 control-label">发动机号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="uengineer" name="account">
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">车头重量：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="uhead_weight" name="account">
                                </div>
                                <label class="col-sm-2 control-label">载重量：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="uload_weight" name="account">
                                </div>

                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">海关编号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="uciq_code" name="account">
                                </div>
                                <label class="col-sm-2 control-label">通关卡号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="uclearance_card" name="account">
                                </div>

                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">IC卡号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="uic_card" name="account">
                                </div>
                                <label class="col-sm-2 control-label">电子关锁号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="uelectronics_clock" name="account">
                                </div>
                            </div>


                            <div class="form-group">

                                <label class="col-sm-2 control-label">经营方式：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="ubussiness_mode" name="account">
                                </div>
                            </div>

                            <div class="form-group">

                                <label class="col-sm-2 control-label">行驶证号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="udriving_license_code" name="account">
                                </div>
                                <label class="col-sm-2 control-label">行驶证有效期：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="udriving_license_date" onclick="layui.laydate({elem: this, format: 'YYYY-MM-DD hh:mm:ss'})" name="account">
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">交强险单号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="uinsurance_force_code" name="account">
                                </div>
                                <label class="col-sm-2 control-label">交强险有效期：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="uinsurance_force_date" onclick="layui.laydate({elem: this, format: 'YYYY-MM-DD hh:mm:ss'})" name="account">
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">二级维护卡号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="umaintain_code" name="account">
                                </div>
                                <label class="col-sm-2 control-label">二级维护卡有效期：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="umaintain_date" onclick="layui.laydate({elem: this, format: 'YYYY-MM-DD hh:mm:ss'})" name="account">
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">商业险单号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="uinsurance_business_code" name="account">
                                </div>
                                <label class="col-sm-2 control-label">商业险有效期：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="uinsurance_business_date" onclick="layui.laydate({elem: this, format: 'YYYY-MM-DD hh:mm:ss'})" name="account">
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">营运审核号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="utaxi_license_code" name="account">
                                </div>
                                <label class="col-sm-2 control-label">营运证综合审核期：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="utaxi_license_date" onclick="layui.laydate({elem: this, format: 'YYYY-MM-DD hh:mm:ss'})" name="account">
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">提醒人：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="uremind_id" name="account">
                                </div>
                                <label class="col-sm-2 control-label">提前提醒天数：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="uremind_day" name="account">
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">备注：</label>
                                <div class="col-sm-8">
                                    <textarea id="uremark" name="comment" class="form-control" required="" aria-required="true"></textarea>
                                </div>
                            </div>

                        </form>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-white" id="gb" data-dismiss="modal">关闭</button>
                            <button type="button" class="btn btn-primary" id="ubaocun">保存</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script src="./src/js/jquery.min.js?v=2.1.4"></script>
        <script>
                                        $(function() {
//                $("#team_id_chosen").css("width", "100%");
//                $("#driver_id_chosen").css("width", "100%");
//                $("#uteam_id_chosen").css("width", "100%");
//                $("#uteam_id").find("option[val = 6]").prop("selected",true);       
                                            //    $("#team_id").find('option[value = 6]').attr("selected", true);
                                            $("tr:gt(0)").click(function() {
                                                ID = $(this).find("input").val();
                                                $("tr").removeClass("bkcl");
                                                $(this).addClass("bkcl");
                                            });
                                            //        $("#baocun").click(function(){
                                            //        });
                                            $('#baocun').click(function() {
                                                var name = $("#name").val();
                                                var team_id = $("#team_id").val();
                                                var mode = $("mode").val();
                                                var driver_id = $("#driver_id").val();
                                                var code = $("#code").val();
                                                var engineer = $("#engineer").val();
                                                var head_weight = $("#head_weight").val();
                                                var load_weight = $("#load_weight").val();
                                                var ciq_code = $("#ciq_code").val();
                                                var clearance_card = $("#clearance_card").val();
                                                var ic_card = $("#ic_card").val();
                                                var electronics_clock = $("#electronics_clock").val();
                                                var bussiness_mode = $("#bussiness_mode").val();
                                                var driving_license_code = $("#driving_license_code").val();
                                                var driving_license_date = $("#driving_license_date").val();
                                                var insurance_force_code = $("#insurance_force_code").val();
                                                var insurance_force_date = $("#insurance_force_date").val();
                                                var maintain_code = $("#maintain_code").val();
                                                var maintain_date = $("#maintain_date").val();
                                                var insurance_business_code = $("#insurance_business_code").val();
                                                var insurance_business_date = $("#insurance_business_date").val();
                                                var taxi_license_code = $("#taxi_license_code").val();
                                                var taxi_license_date = $("#taxi_license_date").val();
                                                var remind_id = $("#remind_id").val();
                                                var remind_day = $("#remind_day").val();
                                                var remark = $("#remark").val();
                                                $.post("./?m=carservice&a=vehicleadd", {
                                                    name: name,
                                                    team_id: team_id,
                                                    mode: mode,
                                                    code: code,
                                                    driver_id: driver_id,
                                                    engineer: engineer,
                                                    head_weight: head_weight,
                                                    load_weight: load_weight,
                                                    ciq_code: ciq_code,
                                                    clearance_card: clearance_card,
                                                    ic_card: ic_card,
                                                    electronics_clock: electronics_clock,
                                                    bussiness_mode: bussiness_mode,
                                                    driving_license_code: driving_license_code,
                                                    driving_license_date: driving_license_date,
                                                    insurance_force_date: insurance_force_date,
                                                    insurance_force_code: insurance_force_code,
                                                    maintain_code: maintain_code,
                                                    maintain_date: maintain_date,
                                                    insurance_business_code: insurance_business_code,
                                                    insurance_business_date: insurance_business_date,
                                                    taxi_license_code: taxi_license_code,
                                                    taxi_license_date: taxi_license_date,
                                                    remind_id: remind_id,
                                                    remind_day: remind_day,
                                                    remark: remark
                                                }, function(result) {
                                                    if (result > 0) {
                                                        swal({
                                                            title: "提交数据成功",
                                                            text: "Submit data successfully"
                                                        }, function() {
                                                            location.href = "./?m=carservice&a=vehicle";
                                                        })
                                                    } else {
                                                        swal({
                                                            title: "提交数据失败",
                                                            text: "Failed to submit data"
                                                        });
                                                    }
                                                    ;
                                                });

                                            });

                                            $("#toupdate").click(function() {
                                                if (ID) {
                                                    $.get("./?m=carservice&a=vehiclejson&id=" + ID, function(data) {
                                                        data = eval("(" + data + ")");
                                                        theid = data['id'];
                                                        $("#uname").val(data['name']);
                                                        $("#uteam_id").val(data['team_id']);
                                                        $("#umode").val(data["mode"]);
                                                        $("#udriver_id").val(data["driver_id"]);
                                                        $("#ucode").val(data['code']);
                                                        $("#uengineer").val(data['engineer']);
                                                        $("#uhead_weight").val(data['head_weight']);
                                                        $("#uload_weight").val(data['load_weight']);
                                                        $("#uciq_code").val(data['ciq_code']);
                                                        $("#uclearance_card").val(data['clearance_card']);
                                                        $("#uic_card").val(data['ic_card']);
                                                        $("#uelectronics_clock").val(data['electronics_clock']);
                                                        $("#ubussiness_mode").val(data['bussiness_mode']);
                                                        $("#udriving_license_code").val(data['driving_license_code']);
                                                        $("#udriving_license_date").val(data['driving_license_date']);
                                                        $("#uinsurance_force_code").val(data['insurance_force_code']);
                                                        $("#uinsurance_force_date").val(data['insurance_force_date']);
                                                        $("#umaintain_code").val(data['maintain_code']);
                                                        $("#umaintain_date").val(data['maintain_date']);
                                                        $("#uinsurance_business_code").val(data['insurance_business_code']);
                                                        $("#uinsurance_business_date").val(data['insurance_business_date']);
                                                        $("#utaxi_license_code").val(data['taxi_license_code']);
                                                        $("#utaxi_license_date").val(data['taxi_license_date']);
                                                        $("#uremind_id").val(data['remind_id']);
                                                        $("#uremind_day").val(data['remind_day']);
                                                        $("#uremark").val(data['remark']);
                                                        $("#uteam_id").find('option[value =' + data['team_id'] + ']').attr("selected", true);
                                                        $("#udriver_id").find('option[value =' + data['driver_id'] + ']').attr("selected", true);
                                                    });
                                                    // return false;
                                                    $("#update").click();
                                                }
                                            });

                                            $('#ubaocun').click(function() {
                                                var name = $("#uname").val();
                                                var team_id = $("#uteam_id").val();
                                                var mode = $("umode").val();
                                                var driver_id = $("#udriver_id").val();
                                                var code = $("#ucode").val();
                                                var engineer = $("#uengineer").val();
                                                var head_weight = $("#uhead_weight").val();
                                                var load_weight = $("#uload_weight").val();
                                                var ciq_code = $("#uciq_code").val();
                                                var clearance_card = $("#uclearance_card").val();
                                                var ic_card = $("#uic_card").val();
                                                var electronics_clock = $("#uelectronics_clock").val();
                                                var bussiness_mode = $("#ubussiness_mode").val();
                                                var driving_license_code = $("#udriving_license_code").val();
                                                var driving_license_date = $("#udriving_license_date").val();
                                                var insurance_force_code = $("#uinsurance_force_code").val();
                                                var insurance_force_date = $("#uinsurance_force_date").val();
                                                var maintain_code = $("#umaintain_code").val();
                                                var maintain_date = $("#umaintain_date").val();
                                                var insurance_business_code = $("#uinsurance_business_code").val();
                                                var insurance_business_date = $("#uinsurance_business_date").val();
                                                var taxi_license_code = $("#utaxi_license_code").val();
                                                var taxi_license_date = $("#utaxi_license_date").val();
                                                var remind_id = $("#uremind_id").val();
                                                var remind_day = $("#uremind_day").val();
                                                var remark = $("#uremark").val();
                                                $.post("./?m=carservice&a=vehicleupdate", {
                                                    name: name,
                                                    team_id: team_id,
                                                    mode: mode,
                                                    code: code,
                                                    driver_id: driver_id,
                                                    engineer: engineer,
                                                    head_weight: head_weight,
                                                    load_weight: load_weight,
                                                    ciq_code: ciq_code,
                                                    clearance_card: clearance_card,
                                                    ic_card: ic_card,
                                                    electronics_clock: electronics_clock,
                                                    bussiness_mode: bussiness_mode,
                                                    driving_license_code: driving_license_code,
                                                    driving_license_date: driving_license_date,
                                                    insurance_force_date: insurance_force_date,
                                                    insurance_force_code: insurance_force_code,
                                                    maintain_code: maintain_code,
                                                    maintain_date: maintain_date,
                                                    insurance_business_code: insurance_business_code,
                                                    insurance_business_date: insurance_business_date,
                                                    taxi_license_code: taxi_license_code,
                                                    taxi_license_date: taxi_license_date,
                                                    remind_id: remind_id,
                                                    remind_day: remind_day,
                                                    remark: remark,
                                                    id: theid
                                                }, function(result) {
                                                    if (result > 0) {
                                                        swal({
                                                            title: "数据修改成功",
                                                            text: "Data modification success"
                                                        }, function() {
                                                            location.href = "./?m=carservice&a=vehicle";
                                                        })
                                                    } else {
                                                        swal({
                                                            title: "数据修改失败",
                                                            text: "Data modification failed"
                                                        });
                                                    }
                                                });

                                            });

                                            $("#dormancy").click(function() {
                                                if (ID) {
                                                    $.get("./?m=carservice&a=vehicledormancy&id=" + ID, function(result) {
                                                        if (result > 0) {
                                                            swal({
                                                                title: "休眠成功",
                                                                text: "dormancy is ok"
                                                            }, function() {
                                                                location.href = "./?m=carservice&a=vehicle";
                                                            });
                                                        }
                                                    });
                                                }
                                            });
                                            $("#activation").click(function() {
                                                if (ID) {
                                                    $.get("./?m=carservice&a=vehicleactivation&id=" + ID, function(result) {
                                                        if (result > 0) {
                                                            swal({
                                                                title: "激活成功",
                                                                text: "activation is ok"
                                                            }, function() {
                                                                location.href = "./?m=carservice&a=vehicle";
                                                            });
                                                        }
                                                    });
                                                }
                                            });

                                            $('#delete').click(function() {
                                                if (ID) {

                                                } else {
                                                    return false;
                                                }
                                                swal({
                                                    title: "您确定要删除这条数据吗",
                                                    text: "请谨慎操作！",
                                                    type: "warning",
                                                    showCancelButton: true,
                                                    confirmButtonColor: "#DD6B55",
                                                    confirmButtonText: "删除",
                                                    cancelButtonText: "取消",
                                                    closeOnConfirm: false
                                                }, function() {
                                                    $.get("./?m=carservice&a=vehicledelete&id=" + ID, function(result) {
                                                        if (result) {
                                                            swal({
                                                                title: "删除成功",
                                                                text: "这条数据将不会出在页面中显示",
                                                                type: "success",
                                                            }, function() {
                                                                location.href = "./?m=carservice&a=vehicle";
                                                            });
                                                        } else {
                                                            swal({
                                                                title: "删除失败",
                                                                type: "error",
                                                            });
                                                        }
                                                    });

                                                });
                                            });
                                        });
        </script>
        <script src="./src/js/bootstrap.min.js?v=3.3.6"></script>

<!--        <script src="./src/js/plugins/chosen/chosen.jquery.js"></script>
        <script src="./src/js/demo/form-advanced-demo.js"></script>-->

        <!-- 自定义js -->
        <script src="./src/js/content.js?v=1.0.0"></script>
        <script src="./src/js/plugins/sweetalert/sweetalert.min.js"></script>

    </body>
</html>
